package com.hw.springcloud.controller;

import cn.hutool.core.lang.UUID;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Classname: PaymentController
 * @Description: consul提供者控制器
 * @Date: 2021/7/7
 * @Author: huwei
 */
@RestController
@Slf4j
public class PaymentController {

    @Value("${server.port}")
    private String serverName;

    /**
     * 验证是否注册到consul中
     * @return
     */
    @GetMapping("/payment/consul")
    public String getConsul(){
        return "Spring Cloud with Consul Port"+serverName+ UUID.randomUUID().toString();
    }
}
